package com.job.GaoYuXuan.Homework0712;

import java.util.Scanner;
import java.util.zip.DeflaterOutputStream;

/**
 * @author 盖
 * @version 1.0
 * @since 2022-07-12 20:34:29
 */
public class Text {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Tigger tigger = new Tigger();
        tigger.setName("Tracy");
        tigger.setVarieties("东北虎");
        while (true){
            System.out.println("请选择攻击方式：");
            System.out.println("1.抓击");
            System.out.println("2.咬击");
            System.out.println("3.扑击");
            int way = input.nextInt();
            Attack att = AttackFactory.getAttack(way);
            if (att == null){
                Attack temp = new Attack() {
                    @Override
                    public void bodyParts() {
                        System.out.println("无此部位");
                    }

                    @Override
                    public void attackMode() {
                        System.out.println("无此攻击方式");
                    }

                    @Override
                    public void aggressivity() {
                        System.out.println("无威胁");
                    }
                };
                temp.bodyParts();
                temp.attackMode();
                temp.aggressivity();
            }else {
                att.aggressivity();
                att.attackMode();
                att.bodyParts();
            }
            System.out.println("是否继续（Yes/Exit）");
            String whether = input.next();
            if("Exit".equals(whether) || "exit".equals(whether)){
                break;
            }else{
                continue;
            }
        }
    }
}